package com.huawei.appgallery.forum.message.card;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.huawei.appgallery.forum.base.card.ForumCard;
import com.huawei.appgallery.forum.base.card.ForumCardBean;
import com.huawei.appgallery.forum.message.bean.ForumRemindGrowupCardBean;
import com.huawei.appgallery.forum.message.bean.ReminderSubReference;
import com.huawei.appgallery.forum.message.widget.SubReferenceView;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import o.bvj.b;
import o.cgz;
import o.dof;
import o.evx;

public class ForumRemindGrowupCard extends ForumCard {
    private ImageView ˊ;
    private View ˋ;
    private TextView ˏ;
    private SubReferenceView ॱ;

    public ForumRemindGrowupCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        ʽ(view);
        this.ˏ = (TextView) view.findViewById(b.ॱᐝ);
        this.ˊ = (ImageView) view.findViewById(b.ˊॱ);
        this.ॱ = (SubReferenceView) view.findViewById(b.ʻॱ);
        this.ˋ = view.findViewById(b.ͺ);
        return this;
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
        if (cardBean instanceof ForumRemindGrowupCardBean) {
            ˏ((ForumRemindGrowupCardBean) cardBean);
            this.ˋ.setVisibility(ˊᐝ() ? 0 : 8);
        }
    }

    private void ˏ(ForumRemindGrowupCardBean forumRemindGrowupCardBean) {
        if (dof.ʽ(forumRemindGrowupCardBean.ˊ())) {
            this.ˏ.setVisibility(8);
            this.ˊ.setVisibility(8);
        } else {
            int i;
            this.ˏ.setVisibility(0);
            this.ˏ.setText(forumRemindGrowupCardBean.ˊ());
            if (!dof.ʽ(forumRemindGrowupCardBean.ॱॱ())) {
                ForumCardBean forumCardBean = new ForumCardBean();
                forumCardBean.ॱ(forumRemindGrowupCardBean.ॱॱ());
                this.ˏ.setTag(forumCardBean);
                this.ˏ.setOnClickListener(new evx(this) {
                    final /* synthetic */ ForumRemindGrowupCard ॱ;

                    {
                        this.ॱ = r1;
                    }

                    public void ˋ(View view) {
                        this.ॱ.ˋ().onClick(this.ॱ.ˏ);
                    }
                });
                if (forumRemindGrowupCardBean.ʼ() == null) {
                    i = 1;
                    if (i == 0) {
                        this.ˊ.setVisibility(0);
                    } else {
                        this.ˊ.setVisibility(8);
                    }
                }
            }
            i = 0;
            if (i == 0) {
                this.ˊ.setVisibility(8);
            } else {
                this.ˊ.setVisibility(0);
            }
        }
        ˊ(forumRemindGrowupCardBean);
    }

    private void ˊ(ForumRemindGrowupCardBean forumRemindGrowupCardBean) {
        ReminderSubReference ʼ = forumRemindGrowupCardBean.ʼ();
        if (ʼ == null) {
            this.ॱ.setVisibility(8);
            return;
        }
        this.ॱ.setVisibility(0);
        this.ॱ.setReference(ʼ);
    }
}
